package com.ava.avamedia.adapter;

import com.ava.avamedia.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class RegionAdapter extends BaseAdapter {
	public String[] region = { "KQ Miền Bắc", "KQ Miền Trung", "KQ Miền Nam" };
	Context ctx;
	LayoutInflater mInflater;
	
	public int getCount() {
		return region.length;
	}

	public RegionAdapter(Context ctx) {
		super();
		this.ctx = ctx;
		mInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	public Object getItem(int arg0) {
		return region[arg0];
	}

	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	public View getView(int arg0, View convertView, ViewGroup arg2) {
		if (convertView == null) {
			convertView = mInflater.inflate(R.layout.adapter_region,null);
		}
		TextView txtRegion = (TextView) convertView.findViewById(R.id.adapter_region_name_region);
		txtRegion.setText(String.valueOf(getItem(arg0)));
		return convertView;
	}

}
